package top.korori.common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

public class NameUtils {
    // 头部
    private static final String[] headerNameArray = new String[]{"快乐的",
            "冷静的",
            "醉熏的",
            "潇洒的",
            "糊涂的",
            "积极的",
            "冷酷的",
            "深情的",
            "粗暴的",
            "温柔的",
            "可爱的",
            "愉快的",
            "义气的",
            "认真的",
            "威武的",
            "帅气的",
            "传统的",
            "潇洒的",
            "漂亮的",
            "自然的",
            "专一的",
            "听话的",
            "昏睡的",
            "狂野的",
            "等待的",
            "搞怪的",
            "幽默的",
            "魁梧的",
            "活泼的",
            "开心的",
            "高兴的",
            "超帅的",
            "留胡子的",
            "坦率的",
            "直率的",
            "轻松的",
            "痴情的",
            "完美的",
            "精明的",
            "无聊的",
            "有魅力的",
            "丰富的",
            "繁荣的",
            "饱满的",
            "炙热的",
            "暴躁的",
            "碧蓝的",
            "俊逸的",
            "英勇的",
            "健忘的",
            "故意的",
            "无心的",
            "土豪的",
            "朴实的",
            "兴奋的",
            "幸福的",
            "淡定的",
            "不安的",
            "阔达的",
            "孤独的",
            "独特的",
            "疯狂的",
            "时尚的",
            "落后的",
            "风趣的",
            "忧伤的",
            "大胆的",
            "爱笑的",
            "矮小的",
            "健康的",
            "合适的",
            "玩命的",
            "沉默的",
            "斯文的",
            "香蕉",
            "苹果",
            "鲤鱼",
            "鳗鱼",
            "任性的",
            "细心的",
            "粗心的",
            "大意的",
            "甜甜的",
            "酷酷的",
            "健壮的",
            "英俊的",
            "霸气的",
            "阳光的",
            "默默的",
            "大力的",
            "孝顺的",
            "忧虑的",
            "着急的",
            "紧张的",
            "善良的",
            "凶狠的",
            "害怕的",
            "重要的",
            "危机的",
            "欢喜的",
            "欣慰的",
            "满意的",
            "跳跃的",
            "诚心的",
            "称心的",
            "如意的",
            "怡然的",
            "娇气的",
            "无奈的",
            "无语的",
            "激动的",
            "愤怒的",
            "美好的",
            "感动的",
            "激情的",
            "激昂的",
            "震动的",
            "虚拟的",
            "超级的",
            "寒冷的",
            "明理的",
            "犹豫的",
            "忧郁的",
            "寂寞的",
            "奋斗的",
            "勤奋的",
            "现代的",
            "过时的",
            "稳重的",
            "热情的",
            "含蓄的",
            "无辜的",
            "多情的",
            "纯真的",
            "拉长的",
            "热心的",
            "从容的",
            "体贴的",
            "风中的",
            "曾经的",
            "追寻的",
            "儒雅的",
            "优雅的",
            "开朗的",
            "外向的",
            "内向的",
            "清爽的",
            "文艺的",
            "长情的",
            "平常的",
            "单身的",
            "伶俐的",
            "高大的",
            "懦弱的",
            "柔弱的",
            "爱笑的",
            "乐观的",
            "耍酷的",
            "酷炫的",
            "神勇的",
            "年轻的",
            "唠叨的",
            "瘦瘦的",
            "无情的",
            "包容的",
            "顺心的",
            "畅快的",
            "舒适的",
            "靓丽的",
            "负责的",
            "背后的",
            "简单的",
            "谦让的",
            "彩色的",
            "缥缈的",
            "欢呼的",
            "生动的",
            "复杂的",
            "慈祥的",
            "仁爱的",
            "魔幻的",
            "虚幻的",
            "淡然的",
            "受伤的",
            "雪白的",
            "高高的",
            "糟糕的",
            "顺利的",
            "闪闪的",
            "羞涩的",
            "缓慢的",
            "迅速的",
            "优秀的",
            "聪明的",
            "含糊的",
            "俏皮的",
            "淡淡的",
            "坚强的",
            "平淡的",
            "欣喜的",
            "能干的",
            "灵巧的",
            "友好的",
            "机智的",
            "机灵的",
            "正直的",
            "谨慎的",
            "俭朴的",
            "殷勤的",
            "虚心的",
            "辛勤的",
            "自觉的",
            "无私的",
            "无限的",
            "踏实的",
            "老实的",
            "现实的",
            "可靠的",
            "务实的",
            "拼搏的",
            "个性的",
            "粗犷的",
            "活力的",
            "成就的",
            "勤劳的",
            "单纯的",
            "落寞的",
            "朴素的",
            "悲凉的",
            "忧心的",
            "洁净的",
            "清秀的",
            "自由的",
            "小巧的",
            "单薄的",
            "贪玩的",
            "刻苦的",
            "干净的",
            "壮观的",
            "和谐的",
            "文静的",
            "调皮的",
            "害羞的",
            "安详的",
            "自信的",
            "端庄的",
            "坚定的",
            "美满的",
            "舒心的",
            "温暖的",
            "专注的",
            "勤恳的",
            "美丽的",
            "腼腆的",
            "优美的",
            "甜美的",
            "甜蜜的",
            "整齐的",
            "动人的",
            "典雅的",
            "尊敬的",
            "舒服的",
            "妩媚的",
            "秀丽的",
            "喜悦的",
            "甜美的",
            "彪壮的",
            "强健的",
            "大方的",
            "俊秀的",
            "聪慧的",
            "迷人的",
            "陶醉的",
            "悦耳的",
            "动听的",
            "明亮的",
            "结实的",
            "魁梧的",
            "标致的",
            "清脆的",
            "敏感的",
            "光亮的",
            "大气的",
            "老迟到的",
            "知性的",
            "冷傲的",
            "呆萌的",
            "野性的",
            "隐形的",
            "笑点低的",
            "微笑的",
            "笨笨的",
            "难过的",
            "沉静的",
            "火星上的",
            "失眠的",
            "安静的",
            "纯情的",
            "要减肥的",
            "迷路的",
            "烂漫的",
            "哭泣的",
            "贤惠的",
            "苗条的",
            "温婉的",
            "发嗲的",
            "会撒娇的",
            "贪玩的",
            "执着的",
            "眯眯眼的",
            "花痴的",
            "想人陪的",
            "眼睛大的",
            "高贵的",
            "傲娇的",
            "心灵美的",
            "爱撒娇的",
            "细腻的",
            "天真的",
            "怕黑的",
            "感性的",
            "飘逸的",
            "怕孤独的",
            "忐忑的",
            "高挑的",
            "傻傻的",
            "冷艳的",
            "爱听歌的",
            "还单身的",
            "怕孤单的",
            "懵懂的"};

    private static final String[] foodNameArray = new String[]{"嚓茶",
            "凉面",
            "便当",
            "毛豆",
            "花生",
            "可乐",
            "灯泡",
            "哈密瓜",
            "野狼",
            "背包",
            "眼神",
            "缘分",
            "雪碧",
            "人生",
            "牛排",
            "蚂蚁",
            "飞鸟",
            "灰狼",
            "斑马",
            "汉堡",
            "悟空",
            "巨人",
            "绿茶",
            "自行车",
            "保温杯",
            "大碗",
            "墨镜",
            "魔镜",
            "煎饼",
            "月饼",
            "月亮",
            "星星",
            "芝麻",
            "啤酒",
            "玫瑰",
            "大叔",
            "小伙",
            "数据线",
            "哈密瓜",
            "太阳",
            "树叶",
            "芹菜",
            "黄蜂",
            "蜜粉",
            "蜜蜂",
            "信封",
            "西装",
            "外套",
            "裙子",
            "大象",
            "猫咪",
            "母鸡",
            "路灯",
            "蓝天",
            "白云",
            "星月",
            "彩虹",
            "微笑",
            "摩托",
            "板栗",
            "高山",
            "大地",
            "大树",
            "电灯胆",
            "砖头",
            "楼房",
            "水池",
            "鸡翅",
            "蜻蜓",
            "红牛",
            "咖啡",
            "机器猫",
            "枕头",
            "大船",
            "诺言",
            "钢笔",
            "刺猬",
            "天空",
            "飞机",
            "大炮",
            "冬天",
            "洋葱",
            "春天",
            "夏天",
            "秋天",
            "冬日",
            "航空",
            "毛衣",
            "豌豆",
            "黑米",
            "玉米",
            "眼睛",
            "老鼠",
            "白羊",
            "帅哥",
            "美女",
            "季节",
            "鲜花",
            "服饰",
            "裙子",
            "白开水",
            "秀发",
            "大山",
            "火车",
            "汽车",
            "歌曲",
            "舞蹈",
            "老师",
            "导师",
            "方盒",
            "大米",
            "麦片",
            "水杯",
            "水壶",
            "手套",
            "鞋子",
            "自行车",
            "鼠标",
            "手机",
            "电脑",
            "书本",
            "奇迹",
            "身影",
            "香烟",
            "夕阳",
            "台灯",
            "宝贝",
            "未来",
            "皮带",
            "钥匙",
            "心锁",
            "故事",
            "花瓣",
            "滑板",
            "画笔",
            "画板",
            "学姐",
            "店员",
            "电源",
            "饼干",
            "宝马",
            "过客",
            "大白",
            "时光",
            "石头",
            "钻石",
            "河马",
            "犀牛",
            "西牛",
            "绿草",
            "抽屉",
            "柜子",
            "往事",
            "寒风",
            "路人",
            "橘子",
            "耳机",
            "鸵鸟",
            "朋友",
            "苗条",
            "铅笔",
            "钢笔",
            "硬币",
            "热狗",
            "大侠",
            "御姐",
            "萝莉",
            "毛巾",
            "期待",
            "盼望",
            "白昼",
            "黑夜",
            "大门",
            "黑裤",
            "钢铁侠",
            "哑铃",
            "板凳",
            "枫叶",
            "荷花",
            "乌龟",
            "仙人掌",
            "衬衫",
            "大神",
            "草丛",
            "早晨",
            "心情",
            "茉莉",
            "流沙",
            "蜗牛",
            "战斗机",
            "冥王星",
            "猎豹",
            "棒球",
            "篮球",
            "乐曲",
            "电话",
            "网络",
            "世界",
            "中心",
            "鱼",
            "鸡",
            "狗",
            "老虎",
            "鸭子",
            "雨",
            "羽毛",
            "翅膀",
            "外套",
            "火",
            "丝袜",
            "书包",
            "钢笔",
            "冷风",
            "八宝粥",
            "烤鸡",
            "大雁",
            "音响",
            "招牌",
            "胡萝卜",
            "冰棍",
            "帽子",
            "菠萝",
            "蛋挞",
            "香水",
            "泥猴桃",
            "吐司",
            "溪流",
            "黄豆",
            "樱桃",
            "小鸽子",
            "小蝴蝶",
            "爆米花",
            "花卷",
            "小鸭子",
            "小海豚",
            "日记本",
            "小熊猫",
            "小懒猪",
            "小懒虫",
            "荔枝",
            "镜子",
            "曲奇",
            "金针菇",
            "小松鼠",
            "小虾米",
            "酒窝",
            "紫菜",
            "金鱼",
            "柚子",
            "果汁",
            "百褶裙",
            "项链",
            "帆布鞋",
            "火龙果",
            "奇异果",
            "煎蛋",
            "唇彩",
            "小土豆",
            "高跟鞋",
            "戒指",
            "雪糕",
            "睫毛",
            "铃铛",
            "手链",
            "香氛",
            "红酒",
            "月光",
            "酸奶",
            "银耳汤",
            "咖啡豆",
            "小蜜蜂",
            "小蚂蚁",
            "蜡烛",
            "棉花糖",
            "向日葵",
            "水蜜桃",
            "小蝴蝶",
            "小刺猬",
            "小丸子",
            "指甲油",
            "康乃馨",
            "糖豆",
            "薯片",
            "口红",
            "超短裙",
            "乌冬面",
            "冰淇淋",
            "棒棒糖",
            "长颈鹿",
            "豆芽",
            "发箍",
            "发卡",
            "发夹",
            "发带",
            "铃铛",
            "小馒头",
            "小笼包",
            "小甜瓜",
            "冬瓜",
            "香菇",
            "小兔子",
            "含羞草",
            "短靴",
            "睫毛膏",
            "小蘑菇",
            "跳跳糖",
            "小白菜",
            "草莓",
            "柠檬",
            "月饼",
            "百合",
            "纸鹤",
            "小天鹅",
            "云朵",
            "芒果",
            "面包",
            "海燕",
            "小猫咪",
            "龙猫",
            "唇膏",
            "鞋垫",
            "羊",
            "黑猫",
            "白猫",
            "万宝路",
            "金毛",
            "山水",
            "音响"};

    static String surname = "辕轩,令狐,钟离,宇文,长孙,幕容,鲜于,闾丘,司徒,司空,丌官,司寇,仉督,子车,颛孙,端木,巫马,公西,漆雕,乐正,壤驷,公良,拓拔,夹谷,宰父,谷梁,晋楚,阎法,汝鄢,涂钦,段干,百里,东郭,南门,呼延,归海,羊舌,微生,岳帅,缑亢,况后,有琴,梁丘,左丘,东门,西门,商牟,佘佴,佰赏,南官,墨哈,谯笪,年爱,阳佟,第五,言福";

    //复姓出现的几率(0--100)
    private static int surnameProbability = 5;

    private static Random random = new Random();


    private static String familyOneName = "赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻水云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任" +
            "袁柳鲍史唐费岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅卞齐康伍余元卜顾孟平黄和穆萧尹姚邵湛汪祁毛禹狄米贝明臧计成戴宋茅庞熊纪舒屈项祝董粱杜阮" +
            "席季麻强贾路娄危江童颜郭梅盛林刁钟徐邱骆高夏蔡田胡凌霍万柯卢莫房缪干解应宗丁宣邓郁单杭洪包诸左石崔吉龚程邢滑裴陆荣翁荀羊甄家封芮储靳邴" +
            "松井富乌焦巴弓牧隗山谷车侯伊宁仇祖武符刘景詹束龙叶幸司韶黎乔苍双闻莘劳逄姬冉宰桂牛寿通边燕冀尚农温庄晏瞿茹习鱼容向古戈终居衡步都耿满弘" +
            "国文东殴沃曾关红游盖益桓公晋楚闫";

    private static String familyTwoName = "欧阳太史端木上官司马东方独孤南宫万俟闻人夏侯诸葛尉迟公羊赫连澹台皇甫宗政濮阳公冶太叔申屠公孙慕容仲孙钟离长孙宇" +
            "文司徒鲜于司空闾丘子车亓官司寇巫马公西颛孙壤驷公良漆雕乐正宰父谷梁拓跋夹谷轩辕令狐段干百里呼延东郭南门羊舌微生公户公玉公仪梁丘公仲公上" +
            "公门公山公坚左丘公伯西门公祖第五公乘贯丘公皙南荣东里东宫仲长子书子桑即墨达奚褚师吴铭";

    private static String boyName = "伟刚勇毅俊峰强军平保东文辉力明永健世广志义兴良海山仁波宁贵福生龙元全国胜学祥才发武新利清飞彬富顺信子杰涛昌成康星光天达" +
            "安岩中茂进林有坚和彪博诚先敬震振壮会思群豪心邦承乐绍功松善厚庆磊民友裕河哲江超浩亮政谦亨奇固之轮翰朗伯宏言若鸣朋斌梁栋维启克伦翔旭鹏泽" +
            "晨辰士以建家致树炎德行时泰盛雄琛钧冠策腾楠榕风航弘";

    private static String girlName = "秀娟英华慧巧美娜静淑惠珠翠雅芝玉萍红娥玲芬芳燕彩春菊兰凤洁梅琳素云莲真环雪荣爱妹霞香月莺媛艳瑞凡佳嘉琼勤珍贞莉桂娣叶璧" +
            "璐娅琦晶妍茜秋珊莎锦黛青倩婷姣婉娴瑾颖露瑶怡婵雁蓓纨仪荷丹蓉眉君琴蕊薇菁梦岚苑婕馨瑗琰韵融园艺咏卿聪澜纯毓悦昭冰爽琬茗羽希宁欣飘育滢馥" +
            "筠柔竹霭凝晓欢霄枫芸菲寒伊亚宜可姬舒影荔枝思丽";

    private static String phoneTwoNum = "3578";


    private static String[] province = {"宁夏省","上海","广西省","重庆","辽宁省","黑龙江省","江苏省","浙江省","福建省","山东省","河南省","湖北省","湖南省","广东省","海南省","四川省","云南省",};
    private static String[] city = {"安康市","安庆市","安顺市","安阳市","鞍山市","巴彦淖尔市","巴中市","白城市","白山市","白银市","百色市","蚌埠市","包头市","宝鸡市","保定市","保山市","北海市","本溪市","滨州市","沧州市","昌都地区","长春市","长沙市","长治市","常德市","常州市","巢湖市","朝阳市","潮州市","郴州市","成都市","承德市","池州市","赤峰市","崇左市","滁州市","达州市","大连市","大庆市","大同市","丹东市","德阳市","德州市","定西市","东莞市","东营市","鄂尔多斯市","鄂州市","防城港市","佛山市","福州市","抚顺市","抚州市","阜新市","阜阳市","甘南州","赣州市","固原市","广安市","广元市","广州市","贵港市","贵阳市","桂林市","哈尔滨市","哈密地区","海北藏族自治州","海东地区","海口市","邯郸市","汉中市","杭州市","毫州市","合肥市","河池市","河源市","菏泽市","贺州市","鹤壁市","鹤岗市","黑河市","衡水市","衡阳市","呼和浩特市","呼伦贝尔市","湖州市","葫芦岛市","怀化市","淮安市","淮北市","淮南市","黄冈市","黄山市","黄石市","惠州市","鸡西市","吉安市","吉林市","济南市","济宁市","佳木斯市","嘉兴市","嘉峪关市","江门市","焦作市","揭阳市","金昌市","金华市","锦州市","晋城市","晋中市","荆门市","荆州市","景德镇市","九江市","酒泉市","开封市","克拉玛依市","昆明市","拉萨市","来宾市","莱芜市","兰州市","廊坊市","乐山市","丽江市","丽水市","连云港市","辽阳市","辽源市","聊城市","临沧市","临汾市","临沂市","柳州市","六安市","六盘水市","龙岩市","陇南市","娄底市","泸州市","吕梁市","洛阳市","漯河市","马鞍山市","茂名市","眉山市","梅州市","绵阳市","牡丹江市","内江市","南昌市","南充市","南京市","南宁市","南平市","南通市","南阳市","宁波市","宁德市","攀枝花市","盘锦市","平顶山市","平凉市","萍乡市","莆田市","濮阳市","普洱市","七台河市","齐齐哈尔市","钦州市","秦皇岛市","青岛市","清远市","庆阳市","曲靖市","衢州市","泉州市","日照市","三门峡市","三明市","三亚市","汕头市","汕尾市","商洛市","商丘市","上饶市","韶关市","邵阳市","绍兴市","深圳市","沈阳市","十堰市","石家庄市","石嘴山市","双鸭山市","朔州市","四平市","松原市","苏州市","宿迁市","宿州市","绥化市","随州市","遂宁市","台州市","太原市","泰安市","泰州市","唐山市","天水市","铁岭市","通化市","通辽市","铜川市","铜陵市","铜仁市","吐鲁番地区","威海市","潍坊市","渭南市","温州市","乌海市","乌兰察布市","乌鲁木齐市","无锡市","吴忠市","芜湖市","梧州市","武汉市","武威市","西安市","西宁市","锡林郭勒盟","厦门市","咸宁市","咸阳市","湘潭市","襄樊市","孝感市","忻州市","新乡市","新余市","信阳市","兴安盟","邢台市","徐州市","许昌市","宣城市","雅安市","烟台市","延安市","盐城市","扬州市","阳江市","阳泉市","伊春市","伊犁哈萨克自治州","宜宾市","宜昌市","宜春市","益阳市","银川市","鹰潭市","营口市","永州市","榆林市","玉林市","玉溪市","岳阳市","云浮市","运城市","枣庄市","湛江市","张家界市","张家口市","张掖市","漳州市","昭通市","肇庆市","镇江市","郑州市","中山市","中卫市","舟山市","周口市","株洲市","珠海市","驻马店市","资阳市","淄博市","自贡市","遵义市",};
    private static String[] area = {"伊春区","带岭区","南岔区","金山屯区","西林区","美溪区","乌马河区","翠峦区","友好区","新青区","上甘岭区","五营区","红星区","汤旺河区","乌伊岭区","榆次区"};
    private static String[] road = {"黄河路","中原路","安波路","新四路","安汾路","安福路","安国路","安化路","安澜路","安龙路","安仁路","安顺路","安亭路","安图路","安业路","安义路","安远路","鞍山路","鞍山支路","澳门路","八一路","巴林路","白城路","白城南路","白渡路","白渡桥","白兰路","白水路","白玉路","百安路（方泰镇）","百官街","百花街","百色路","板泉路","半淞园路","包头路","包头南路","宝安公路","宝安路","宝昌路","宝联路","宝林路","宝祁路","宝山路","宝通路","宝杨路","宝源路","保德路","保定路","保屯路","保屯路","北艾路",};
    private static String[] home = {"金色家园","耀江花园","阳光翠竹苑","东新大厦","溢盈河畔别墅","真新六街坊","和亭佳苑","协通公寓","博泰新苑","菊园五街坊","住友嘉馨名园","复华城市花园","爱里舍花园"};

    private static String passwordForm = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz~!@#$%^&*()_+{}|<>?";
    private static String[] avatar = {
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/c01880d8c0ef443ec69263e049bb174d.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/84cb8307839f17ca7404e396120a216c.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/7071ae7a0468415cd05a89ad4c2bfb5b.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/b46813b4d105bbde0f84727fe1936c75.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/a7f4f7b16d1beb1a726631def7ca58b8.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/785e60333ac9316aa9a77f933ac742dc.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/3e4580e54b7f318920d8bc975473143e.jpg",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/7c0aa53b854d36a279a0d49052d62e85.jpeg",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/3f68c7ecbf497983a5589d4aaddaa012.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/be1922fd9787619b622283364c0a37c3.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/f91eac66f281f86dbe4854517c5dd4f8.webp",
            "https://blog-1252225734.cos.ap-guangzhou.myqcloud.com/photos/58a03a93af1957e1de9f9a6260185e04.webp",
    };
    static String[] surnameArray = {};

    static {
        surnameArray = surname.split(",");
    }

    /**
     * 生成随机数
     */
    public static int randomInt() {
        return random.nextInt();
    }

    /**
     * 生成随机数(最大值限制)
     */
    public static int randomInt(int maxNum) {
        return random.nextInt(maxNum);
    }


    /**
     * 获取随机男生姓名
     */
    public static String getRandomBoyName(){
        int bodNameIndexOne = randomInt(boyName.length());
        int bodNameIndexTwo = randomInt(boyName.length());
        if (randomInt(100) > surnameProbability){
            int familyOneNameIndex = randomInt(familyOneName.length());
            return familyOneName.substring(familyOneNameIndex, familyOneNameIndex+1) +
                    boyName.substring(bodNameIndexOne, bodNameIndexOne+1) +
                    boyName.substring(bodNameIndexTwo, bodNameIndexTwo+1);
        }else {
            int familyTwoNameIndex = randomInt(familyTwoName.length());
            familyTwoNameIndex = familyTwoNameIndex%2 == 0 ? familyTwoNameIndex : familyTwoNameIndex-1;
            return familyTwoName.substring(familyTwoNameIndex, familyTwoNameIndex+2) +
                    boyName.substring(bodNameIndexOne, bodNameIndexOne+1) +
                    boyName.substring(bodNameIndexTwo, bodNameIndexTwo+1);
        }
    }


    /**
     * 获取女生姓名
     */
    public static String getRandomGirlName(){
        int bodNameIndexOne = randomInt(girlName.length());
        int bodNameIndexTwo = randomInt(girlName.length());
        if (randomInt(100) > surnameProbability){
            int familyOneNameIndex = randomInt(familyOneName.length());
            return familyOneName.substring(familyOneNameIndex, familyOneNameIndex+1) +
                    girlName.substring(bodNameIndexOne, bodNameIndexOne+1) +
                    girlName.substring(bodNameIndexTwo, bodNameIndexTwo+1);
        }else {
            int familyTwoNameIndex = randomInt(familyTwoName.length());
            familyTwoNameIndex = familyTwoNameIndex%2 == 0 ? familyTwoNameIndex : familyTwoNameIndex-1;
            return familyTwoName.substring(familyTwoNameIndex, familyTwoNameIndex+2) +
                    girlName.substring(bodNameIndexOne, bodNameIndexOne+1) +
                    girlName.substring(bodNameIndexTwo, bodNameIndexTwo+1);
        }
    }


    /**
     * 获取随机手机号
     */
    public static String getRandomPhone(){
        int phoneTwoRandomIndex = randomInt(4);
        return "1" + phoneTwoNum.substring(phoneTwoRandomIndex, phoneTwoRandomIndex+1) + (100000000 + randomInt(899999999));
    }


    /**
     * 获取随机qq邮箱
     */
    public static String getRandomQQEmail(){
        return (""+random.nextLong()).substring(10) + "@qq.com";
    }

    /**
     * 获取随机性别
     */
    public static String getRandomSex(){
        return randomInt(2)%2 == 0 ? "男" : "女";
    }

    /**
     * 获取随机年龄
     */
    public static int getRandomAge(int min, int max){
        return min + random.nextInt(max-min);
    }


    /**
     * 获取随机年龄(18-25)
     */
    public static int getRandomAge(){
        return getRandomAge(18, 25);
    }


    /**
     * 获取随机住址
     */
    public static String getRandomAddress(){
        return province[randomInt(province.length)] +
                city[randomInt(city.length)] +
                area[randomInt(area.length)] +
                road[randomInt(road.length)] +
                home[randomInt(home.length)];
    }

    /**
     * 获取随机住址
     */
    public static String getProvince(){
        return province[randomInt(province.length)];
    }


    /**
     * 获取随机密码(指定长度)
     */
    public static String getRandomPassword(int length){
        StringBuilder springBuilder = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int index = randomInt(passwordForm.length());
            springBuilder.append(passwordForm.substring(index, index+1));
        }
        return springBuilder.toString();
    }


    /**
     * 获取随机密码(指定长度)
     */
    public static String getRandomPassword(){
        return getRandomPassword(12);
    }

    // 随机函数

    public static ThreadLocalRandom getRandom(){
        return ThreadLocalRandom.current();
    }



    /**
     * 生成网络昵称
     *
     * @return 昵称
     */
    private static String getNickName() {
        int headNameIndex = getRandom().nextInt(headerNameArray.length);
        int foodNameIndex = getRandom().nextInt(foodNameArray.length);
        return headerNameArray[headNameIndex] + foodNameArray[foodNameIndex];
    }

    /**
     * 生成带有复姓的昵称
     *
     * @return 昵称
     */
    private static String getTwoSurname() {
        int headNameIndex = getRandom().nextInt(surnameArray.length);
        int foodNameIndex = getRandom().nextInt(foodNameArray.length);
        return surnameArray[headNameIndex] + foodNameArray[foodNameIndex];
    }

    /**
     * 获取管理员名称
     *
     * @return 管理员
     */
    public static String getAdminName() {
        int headNameIndex = getRandom().nextInt(headerNameArray.length);
        return headerNameArray[headNameIndex] + "管理员";
    }

    /**
     * 获取昵称
     *
     * @return 昵称
     */
    public static String getName() {
        int i = getRandom().nextInt(2);
        return i == 0 ? getNickName() : getTwoSurname();
    }

    public static void main(String[] args) {
        for (int j = 0; j < 100; j++) {
            System.out.println(getName());
            System.out.println(getAdminName());
        }
    }

    public void testRondomDate() {
        Date date = randomDate("2009-07-01","2009-09-01");
        System.out.println(new SimpleDateFormat("yyyy.MM.dd HH:mm:ss").format(date));
    }

    public static String getRandomIp() {
        // 指定 IP 范围
        int[][] range = {
                {607649792, 608174079}, // 36.56.0.0-36.63.255.255
                {1038614528, 1039007743}, // 61.232.0.0-61.237.255.255
                {1783627776, 1784676351}, // 106.80.0.0-106.95.255.255
                {2035023872, 2035154943}, // 121.76.0.0-121.77.255.255
                {2078801920, 2079064063}, // 123.232.0.0-123.235.255.255
                {-1950089216, -1948778497}, // 139.196.0.0-139.215.255.255
                {-1425539072, -1425014785}, // 171.8.0.0-171.15.255.255
                {-1236271104, -1235419137}, // 182.80.0.0-182.92.255.255
                {-770113536, -768606209}, // 210.25.0.0-210.47.255.255
                {-569376768, -564133889}, // 222.16.0.0-222.95.255.255
        };

        Random random = new Random();
        int index = random.nextInt(10);
        String ip = num2ip(range[index][0] + random.nextInt(range[index][1] - range[index][0]));
        return ip;
    }

    public static String getAvatar(){
        return  avatar[randomInt(11)];
    }

    /**
     * 将十进制转换成IP地址
     */
    public static String num2ip(int ip) {
        int[] b = new int[4];
        b[0] = (ip >> 24) & 0xff;
        b[1] = (ip >> 16) & 0xff;
        b[2] = (ip >> 8) & 0xff;
        b[3] = ip & 0xff;
        // 拼接 IP
        String x = b[0] + "." + b[1] + "." + b[2] + "." + b[3];
        return x;
    }



    /**
     * 获取随机日期
     * @param beginDate 起始日期，格式为：yyyy-MM-dd
     * @param endDate 结束日期，格式为：yyyy-MM-dd
     * @return
     */
    public static Date randomDate(String beginDate, String endDate){
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            Date start = format.parse(beginDate);
            Date end = format.parse(endDate);

            if(start.getTime() >= end.getTime()){
                return null;
            }

            long date = random(start.getTime(),end.getTime());

            return new Date(date);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static Date randomTime(String beginDate, String endDate){
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            Date start = format.parse(beginDate);
            Date end = format.parse(endDate);

            if(start.getTime() >= end.getTime()){
                return null;
            }

            long date = random(start.getTime(),end.getTime());

            return new Date(date);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    private static long random(long begin,long end){
        long rtn = begin + (long)(Math.random() * (end - begin));
        if(rtn == begin || rtn == end){
            return random(begin,end);
        }
        return rtn;
    }

}
